package com.cn.http.impl;

import com.cn.http.HttpConfig;

import java.net.Proxy;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * &#064;Time 2024 八月 星期六 13:58
 *
 * @author ShangGuan
 */
public class SimpleHttpConfig implements HttpConfig {

    private final Map<String, Object> hashMapHeaders = new ConcurrentHashMap<>();

    @Override
    public HttpConfig addConfig(String key, String value) {
        hashMapHeaders.put(key, value);
        return this;
    }

    @Override
    public void setConnectTimeout(int connectTimeout) {
        hashMapHeaders.put("ConnectTimeout", connectTimeout);
    }

    @Override
    public Map<String, Object> getConfig() {
        return hashMapHeaders;
    }

    @Override
    public void setReadTimeout(int readTimeout) {
        hashMapHeaders.put("ReadTimeout", readTimeout);
    }

    @Override
    public void setContentType(String chartForm) {
        hashMapHeaders.put("ContentType", chartForm);
    }

    @Override
    public void setProxy(Proxy proxy) {

    }
}
